{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 ArialMT;\f2\fnil\fcharset0 Monaco;
\f3\fnil\fcharset0 LucidaGrande;\f4\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;\red52\green52\blue52;\red252\green0\blue8;\red52\green52\blue52;
}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid1\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs30 \cf0 \ul \ulc0 0. Principles
\fs24 \ulnone \
\pard\pardeftab720\sl340\ql\qnatural

\f1 \cf0   - In JavaFX, everything is an expression.
\f0\fs30 \ul \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\fs24 \cf0 \ulnone \
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\fs30 \cf0 \ul \ulc0 2. Writing Scripts\

\fs24 \ulnone   -\'a0Declaring Script Variables\
      - 
\b def
\b0 : constant\
      - 
\b var
\b0 : variable\
      - 
\b function
\b0 \
\
  -\'a0Script Functions\

\fs22 	
\f2\fs20 \cf2 add(
\f1\fs22 \cf3 100,10
\f2\fs20 \cf2 );\

\f0\fs22 \cf0 \
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	function add(
\f1\fs22 \cf3 argOne: Integer, argTwo: Integer
\f2\fs20 \cf2 ) \{\
	    result = argOne + argTwo;\
	    println("\ul \{argOne\}\ulnone  + \ul \{argTwo\}\ulnone  = \ul \{result\}\ulnone ");\
	\}\
\
	function add(argOne: Integer, argTwo: Integer) 
\f1\fs22 \cf3 : Integer
\f2\fs20 \cf2  \{\
	     result = argOne + argTwo;\
	     println("\{argOne\} + \{argTwo\} = \{result\}");\
	     
\f1\fs22 \cf3 return result;
\f2\fs20 \cf2 \
	\}
\fs22 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 \
  -\'a0Accessing Command-Line Arguments\
\pard\pardeftab720\sl340

\f1\fs22 \cf3 	function run(args : String[]) \{\
	     // Convert Strings to Integers\
	     def numOne = java.lang.Integer.parseInt(args[0]);\
	     def numTwo = java.lang.Integer.parseInt(args[1]);\
	     // Invoke Functions \
	     add(numOne,numTwo);\
	     subtract(numOne,numTwo);\
	     multiply(numOne,numTwo);\
	     divide(numOne,numTwo);\
	\}
\f2 \cf2 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 \
  -\'a0Testing for Read-Only Variables\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	var y;\
	var x = bind y;\
	println("is x bound ? \{isReadOnly(x)\}");\
	println("is y bound ? \{isReadOnly(y)\}");
\f0\fs22 \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f3\fs24 \cf0     \uc0\u8594 
\f0  \
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	is x bound ? true\
	is y bound ? false
\f0\fs22 \cf0 \

\fs24 \
\

\fs30 \ul 3. Using Objects
\fs24 \ulnone \
  - Declaring an Object Literal\
\pard\pardeftab720\sl340\ql\qnatural

\b \cf0 EX1
\f4\b0 	public class Address \{\
\pard\pardeftab720\ql\qnatural
\cf0 	    public var street: String;\
	    public var city: String;\
	    public var state: String;\
	    public var zip: String;\
	\}\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 \
\pard\pardeftab720\sl340\ql\qnatural

\f0\b\fs24 \cf0 EX2
\f4\b0 	public class Customer \{\
\pard\pardeftab720\ql\qnatural
\cf0 	     public var firstName: String;\
	     public var lastName: String;\
	     public var phoneNum: String;\
	     public var address: Address;\
\
	    public function printName() \{\
	        println("Name: \{firstName\} \{lastName\}");\
	    \}\
	    public function printPhoneNum()\{\
	        println("Phone: \{phoneNum\}");\
	    \}\
	    public function printAddress()\{\
	        println("Street: \{address.street\}");\
	        println("City: \{address.city\}");\
	        println("State: \{address.state\}");\
	        println("Zip: \{address.zip\}");\
	    \}\
	\}\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 \
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0   - Instantiate\

\b EX1
\f2\b0\fs20 \cf2 	Address \{\
\pard\pardeftab720\sl340
\cf2 	     street: "1 Main Street";\
	     city: "Santa Clara";\
	     state: "CA";\
	     zip: "95050";\
	\}
\fs22 \

\f0\fs24 \cf0 \

\f2\fs20 \cf2 	\ul var myAddress\ulnone  = Address \{\
	     street: "1 Main Street";\
	     city: "Santa Clara";\
	     state: "CA";\
	     zip: "95050";\
	\}
\fs22 \

\f0\fs24 \cf0 \

\b EX2
\f2\b0\fs22 \cf2 	\ul var customer = Customer\ulnone  \{\
	     firstName: "John";\
	     lastName: "Doe";\
	     phoneNum: "(408) 555-0101";\
	     \ul address: Address\ulnone  \{\
	          street: "1 Main Street";\
	          city: "Santa Clara";\
	          state: "CA";\
	          zip: "95050";\
	     \}\
	\}
\f0\fs24 \cf0 \
\
\

\fs30 \ul 4. Data Types
\fs24 \ulnone \
  - String\
      - declaration: either " or '\

\f2\fs20 \cf2 	var s1 = 'Hello';\
	var s2 = "Hello";\

\f0\fs24 \cf0       - embed: \{\}\

\f2\fs20 \cf2 	def name = 'Joe';\
	var s = "Hello \{name\}"; // s = 'Hello Joe'\

\f0\fs24 \cf0       - concatenate: \{\}\

\f2\fs20 \cf2 	def one = "This example ";\
	def two = "joins two strings.";\
	def three = "\{one\}\{two\}";      // join string one and string two\
	println(three);                // 'This example joins two strings.'\

\f0\fs24 \cf0       - w/ ternary operator\

\f2\fs20 \cf2 	def answer = true;\
	var s = "The answer is \{if (answer) "Yes" else "No"\}";\
								 // s = 'The answer is Yes'
\fs22 \
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0 \
\pard\pardeftab720\sl340
\cf0   - Number (float) and Integer (int)\
\pard\pardeftab720\sl340\ql\qnatural
\cf0       - implicit\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	def numOne = 1.0; // compiler will infer Number \
	def numTwo = 1;   // compiler will infer Integer\
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0       - explicit\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	def numOne : Number = 1.0;\
	def numTwo : Integer = 1;\
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0       - NOTE\
\pard\pardeftab720\sl340\ql\qnatural

\f1 \cf0 	The language also contains numeric types that align with those found in the Java programming language. The full list of numeric types is therefore: 
\f2 \cf2 Byte
\f1 \cf0 , 
\f2 \cf2 Short
\f1 \cf0 , 
\f2 \cf2 Number
\f1 \cf0 , 
\f2 \cf2 Integer
\f1 \cf0 , 
\f2 \cf2 Long
\f1 \cf0 , 
\f2 \cf2 Float
\f1 \cf0 , 
\f2 \cf2 Double
\f1 \cf0 , and 
\f2 \cf2 Character
\f1 \cf0 .
\f0 \
\pard\pardeftab720\sl340
\cf0 \
  - Boolean\
\pard\pardeftab720\sl340\ql\qnatural
\cf0       - true or false\
\pard\pardeftab720\sl340
\cf0 \
  - Duration\
\pard\pardeftab720\sl340\ql\qnatural
\cf0       - represents a fixed unit of time\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	5ms; // 5 milliseconds\
	10s; // 10 seconds\
	30m; // 30 minutes\
	1h;  // 1 hour\
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0 \
\pard\pardeftab720\sl340
\cf0   - Void (starts w/ a capital V)\

\fs22 	
\f2\fs20 \cf2 function printMe() : Void \{\
	     println("I don't return anything!");\
	\}\

\f0\fs24 \cf0 \
      is equiv to\
\

\f2\fs20 \cf2 	function printMe() \{\
	     println("I don't return anything!");\
	\}\

\f0\fs24 \cf0 \
  - null (starts w/ lower case n)\

\f2\fs22 \cf2 \

\f0\fs24 \cf0   - Function Type\
      - Functions are dealt like a variable\
          - declaration: like a prototype -- the initial value is null\

\f2\fs22 \cf2 	
\fs20 var myFunc : function(:Object,:Integer):String;
\fs22 \

\f0\fs24 \cf0           - can be reassigned to any function with those parameters and return type\

\f2\fs20 \cf2 	myFunc = function(obj : Object, k : Integer) \{ "So!" \}
\f0\fs24 \cf0 \
\
\

\fs30 \ul 5. Sequences (array)
\fs24 \ulnone \
  - Creating Sequences\
      - implicit\

\f2\fs20 \cf2 	def weekDays = ["Mon","Tue","Wed","Thu","Fri"];
\f0\fs24 \cf0 \
      - explicit\

\fs22 	
\f2\fs20 \cf2 def weekDays: String[] = ["Mon","Tue","Wed","Thu","Fri"];
\fs22 \

\f0\fs24 \cf0       - reuse\

\f2\fs20 \cf2 	def days = [weekDays, ["Sat","Sun"]];
\f0\fs24 \cf0 \
        is equiv to\

\f2\fs22 \cf2 	
\fs20 def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];
\fs22 \

\f0\fs24 \cf0       - shorthand notation\

\f2\fs20 \cf2 	def nums = [1..100];
\f0\fs24 \cf0 \
\
  - Using Predicates: making a subset of a sequence by using a boolean expr\

\f2\fs20 \cf2 	def nums = [1,2,3,4,5];\

\f0\fs22 \cf0 	
\f2\fs20 \cf2 def numsGreaterThanTwo = nums[n | n > 2];		// [ 3, 4, 5 ]
\f0\fs22 \cf0 \

\fs24 \
  - Accessing Sequence Items\
      - i-th value\

\f2\fs20 \cf2 	def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	println(days[0]);\

\f0\fs24 \cf0       - sizeof\

\f2\fs22 \cf2 	
\fs20 sizeof days
\fs22 \

\f0\fs24 \cf0 \

\f2\fs20 \cf2 	def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	println(sizeof days);
\f0\fs24 \cf0 \
\
- Inserting / Deleting Items into a Sequence\

\b EX
\b0 	
\f2\fs20 \cf2 var days = ["Mon"];\

\f0\fs22 \cf0 	
\f2\fs20 \cf2 insert "Tue" into days;\
	insert "Fri" into days;\

\f0\fs22 \cf0 	
\f2\fs20 \cf2 insert "Thu" before days[2];\

\f0\fs22 \cf0 \

\fs20 	
\f3 \uc0\u8594 
\f2 \cf2  // "Mon"
\f1 \cf0 , 
\f2 \cf2 "Tue"
\f1 \cf0 , 
\f2 \cf2 "Thu"
\f1 \cf0 , 
\f2 \cf2 "Fri"
\f0\fs22 \cf0 \

\fs24 \

\b EX
\b0 	
\f2\fs20 \cf2 delete "Fri" from days;\
	delete days[0];\
	delete days;\

\f0\fs24 \cf0 \
  - Reversing the Items in a Sequence\
      - reverse\

\f2\fs20 \cf2 	var nums = [1..5];\
	nums = reverse nums; // returns [5, 4, 3, 2, 1]\

\f0\fs24 \cf0 \
  - Comparing Sequences\
      - direct comparisons are possible\

\f2\fs20 \cf2 EX1	def seq1 = [1,2,3,4,5];\
	def seq2 = [1,2,3,4,5];\
	println(seq1 == seq2);		// true\
\
EX2	def seq1 = [1,2,3,4,5];\
	def seq2 = [1,2,3,4,5,6];\
	println(seq1 == seq2);	// false
\fs22 \

\f0\fs24 \cf0 \
  - Using Sequences Slices\
      - seq[a..b]\

\f2\fs20 \cf2 	def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	def weekend = days[5..6];
\f0\fs22 \cf0 \

\fs24       - seq[a..<b]\

\f2\fs20 \cf2 	def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	def weekdays = days[0..<5];\

\f0\fs24 \cf0       - seq[a..]\

\f2\fs20 \cf2 	def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	def weekend = days[5..];\

\f0\fs24 \cf0       - seq[a..<]\

\f2\fs20 \cf2 	def days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	def days2 = days[0..<];\

\f0\fs24 \cf0 \
\

\fs30 \ul 6. Operators
\fs24 \ulnone \
  - Assignment Operators\

\f2\fs20 \cf2 	result = num1 + num2;\
	days = ["Mon","Tue","Wed","Thu","Fri"];\

\f0\fs24 \cf0 \
  - Arithmetic Operators\

\f2\fs20 \cf2 	+ (additive operator)\
	- (subtraction operator)\
	* (multiplication operator)\
	/ (division operator)\
		+=, -=, *=, /= are possible\

\fs22 	mod (remainder operator)\

\f0\fs24 \cf0 		mod= is NOT possible\
\
  - Unary Operators\

\f2\fs20 \cf2 	- 	Unary minus operator; negates a number\
	++  	Increment operator; increments a value by 1\
	--    Decrement operator; decrements a value by 1\
	not   Logical complement operator; inverts the value of a boolean
\f0\fs24 \cf0 \
\
  - Equality and Relational Operators\

\f2\fs20 \cf2 	==	equal to\
	!=	not equal to\
	>	greater than\
	>=	greater than or equal to\
	<	less than\
	<=	less than or equal to\

\f0\fs24 \cf0 \
  - Conditional Operators\

\f2\fs20 \cf2 	and\
	or\

\f0\fs24 \cf0 \
  - Type Comparison Operator (instanceof)\

\f2\fs20 \cf2 	def str1="Hello";\
	println(str1 instanceof String);  // prints true\
\
	def num = 1031;\
	println(num instanceof Integer); // prints true
\f0\fs24 \cf0 \
\
\

\fs30 \ul 7. Expression
\fs24 \ulnone \
  - Block Expressions: 
\f1 A 
\i block expression
\i0  consists of a list of declarations or expressions surrounded by curly braces and separated by semicolons. The value of a block expression is the value of the last expression. If the block expression contains no expressions, the block expression has 
\f2 \cf2 Void
\f1 \cf0  type. Note that 
\f2 \cf2 var
\f1 \cf0  and 
\f2 \cf2 def
\f1 \cf0  are expressions.\

\f0 \

\b EX
\b0 	
\f2\fs20 \cf2 var nums = [5, 7, 3, 9];\
	var total = \{\
	     var sum = 0;\
	     for (a in nums) \{ sum += a \};\
	     sum;\
	\}\
	println("Total is \{total\}.");		// Total is 24.
\fs22 \

\f0\fs24 \cf0 \
  - The if Expression\
      - same as in Java\
      - can be collapsed like this:\

\f2\fs20 \cf2     ticketPrice = if (age < 5) 0 else if (age < 12 or age > 65) 5 else 10;
\f0\fs24 \cf0 \
\
  - Range Expressions\
EX1	
\f2\fs20 \cf2 var num = [0..5];
\f0\fs24 \cf0 \

\b EX2
\b0 	
\f2\fs20 \cf2 var nums = [1..10 step 2];	// [ 1, 3, 5, 7, 9 ]
\fs22 \

\f0\b\fs24 \cf0 EX3
\b0 	
\f2\fs20 \cf2 var nums = [10..1 step -1];	// [ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
\f0\fs24 \cf0 \
\

\b CAUTION
\b0 	
\f2\fs22 \cf2 var nums = [10..1 step 1];
\f0\fs24 \cf0 \
	- will r
\f1 esult in a compile-time warning.\
	- will end up with an empty sequence.
\f0 \
\
  - The for Expression\

\f2\fs20 \cf2 EX	var days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];\
	for (day in days) \{\
	     println(day);\
	\}
\f0\fs24 \cf0 \
\

\f2\fs20 \cf2 EX	// Resulting sequence squares the values from the original sequence.\
	var squares = for (i in [1..10]) i*i; \
\
EX	// Resulting sequence is ["MON", "TUE", "WED", and so on...]\
	var capitalDays = for (day in days) day.toUpperCase(); \

\f0\fs24 \cf0 \
\
  - The while Expression\
  - The break and continue Expressions\
  - The throw, try, catch and finally Expressions\

\f2\fs20 \cf2 EX	try \{\
	     foo();\
	\} catch (e: Exception) \{\
	     println("\{e.getMessage()\} (but we caught it)");\
	\} finally \{\
	     println("We are now in the finally expression...");\
	\}\

\f0\fs24 \cf0 \
\

\b\fs30 \ul 8. Data Binding and Trigger Basics
\b0\fs24 \ulnone \
  - Concept: 
\f1 variable 
\f2 \cf2 a
\f1 \cf0  is bound to variable 
\f2 \cf2 b
\f1 \cf0 . Whenever the value of 
\f2 \cf2 a
\f1 \cf0 changes, the value of 
\f2 \cf2 b
\f1 \cf0  automatically changes as well.
\f0 \
EX	
\f2\fs20 \cf2 var a = "Hello";\
	var b = \cf3 bind\cf2  a;\
	println("a:\{a\} b:\{b\}");\
	a = "Good-Bye";\
	println("a:\{a\} b:\{b\}");
\f0\fs24 \cf0 \

\b OUTPUT
\b0 	
\f2\fs20 \cf2 a:Hello b:Hello\
		a:Good-Bye b:Good-Bye
\fs22 \

\f0\fs24 \cf0 \

\b EX
\b0 	
\f2\fs20 \cf2 var a = 10;\
	var b = \cf3 bind\cf2  (a+10);\
	println("a:\{a\} b:\{b\}");\
	a = 20;\
	println("a:\{a\} b:\{b\}");
\f0\fs24 \cf0 \

\b OUTPUT
\b0\fs22 	
\f2\fs20 \cf2 a:10 b:20\
		a:20 b:30
\f0\fs24 \cf0 \
\
\
\

\fs30 \ul 9. Writing Your Own Classes
\fs24 \ulnone \
  - Inheriting from Other Classes\

\b EX - parent  
\f2\b0\fs18 \cf4 // 
\fs22 abstract
\f1 \cf0 : meaning that 
\f2 \cf4 Account
\f1 \cf0  objects cannot be created directly
\f0\b\fs24 \

\b0 	
\f2\fs20 \cf2 abstract class Account \{\
	     var accountNum: Integer;\
	     var balance: Number;\
\
	     function getBalance(): Number \{ return balance; \}\
	     function deposit(amount: Number): Void \{ balance += amount; \}\
	     function withdraw(amount: Number): Void \{ balance -= amount; \}\
	\}
\fs22 \

\f0 \cf0 \
\pard\pardeftab720\sl340\ql\qnatural

\b\fs24 \cf0 EX - child1
\b0\fs22 \
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	class SavingsAccount extends Account \{\
	     var minBalance = 100.00;\
	     var penalty = 5.00;\
\
	     function checkMinBalance() : Void \{\
		\'85\
	     \}\
	\}\

\f0\fs22 \cf0 \
\pard\pardeftab720\sl340\ql\qnatural

\b\fs24 \cf0 EX - child2
\b0 \
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	class CheckingAccount extends Account \{\
	     var hasOverDraftProtection: Boolean;\
	     override function withdraw(amount: Number) : Void \{\
		...\
          \}\
     \}\
\

\f0\fs24 \cf0   - Using Mixin Inheritance: 
\f1 The JavaFX Script programming language does not support multiple inheritance; it instead supports 
\i mixin inheritance
\i0 , which provides many of the same benefits, but results in simpler, smaller, and faster generated code.\
\pard\pardeftab720\sl340\sa340
\cf0 A 
\i mixin
\i0  is a special kind of class. It is one that 
\b cannot be instantiated directly
\b0 , but rather, is 
\b designed to be extended and then used by its subclasses
\b0 . Mixins look like regular classes, but have the 
\f2 \cf2 mixin
\f1 \cf0  keyword included in their declaration. As with regular classes, mixin classes may define any number of variables or functions:\
\pard\pardeftab720\sl340

\f0\b \cf0   - RULES\
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl340
\ls1\ilvl0
\f1\b0 \cf0 {\listtext	1.	}JavaFX classes are allowed to extend, at most, one other JavaFX class. Because the JavaFX Script programming language is based on the Java platform, this superclass also could be written in Java and your code would still compile and run correctly.
\f3 \uc0\u8232 
\f1 \
{\listtext	2.	}JavaFX classes are allowed to extend any number of JavaFX mixin classes. (If you are a Java programmer, know that JavaFX classes can also extend any number of Java interfaces as well.)
\f3 \uc0\u8232 
\f1 \
{\listtext	3.	}JavaFX mixin classes are allowed to extend any number of other JavaFX mixin classes. As with #2 above, JavaFX mixin classes may also extend any number of Java interfaces.\
\pard\pardeftab720\sl340

\f0\b \cf0 \
EX1
\b0 	
\f2\fs20 \cf2 def  myMixee = MyMixee\{\};\
	myMixee.printName();\
\
	mixin class MyMixin \{\
	     var firstName = "John";\
	     var lastName = "Doe";\
	     function printName()\{\
	          println("My name is: \{firstName\} \{lastName\}");\
	     \}\
	\}\
\
	class MyMixee extends MyMixin \{ \}
\fs22 \

\f0\fs24 \cf0 \

\b EX2
\b0 	
\f2\fs20 \cf2 def myContact = MyContact\{\};\
	myContact.printName();\
	myContact.printAddress();\
\
	mixin class MyNameMixin \{\
	     var firstName = "John";\
	     var lastName = "Doe";\
	     function printName()\{\
	          println("My name is: \{firstName\} \{lastName\}");\
	     \}\
	\}\
	mixin class MyAddressMixin \{\
	     var address = "1 Main Street, Anytown USA";\
	     function printAddress()\{\
	          println("My address is: \{address\}");\
	     \}\
	\}\
\
	class MyContact extends MyNameMixin, MyAddressMixin \{ \}
\fs22 \
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0 \
\

\fs30 \ul 10. Packages
\fs24 \ulnone  (Packages allow you to organize and structure your classes)\
  - Step 1: Choose a Package Name\
  - Step 2: Create the Directory\
  - Step 3: Add the Package Declaration\
  - Step 4: Add the Access Modifiers\
  - Step 5: Compile the Source\
  - Step 6: Use the Class\
\
 * Compile (from the tutorial parent directory)\
\pard\pardeftab720\sl340

\f2\fs22 \cf2 	javafxc tutorial/one.fx tutorial/two.fx\
	javafx tutorial.two\
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0 \
\

\fs30 \ul 11. Access Modifiers
\fs24 \ulnone \
  - Default Access:  "script-only"\
\pard\pardeftab720\sl340

\f2\fs20 \cf2 	var x;\
	var x : String;\
	var x = z + 22;\
	var x = bind f(q);\
\pard\pardeftab720\sl340\ql\qnatural

\f0\fs24 \cf0 \
  - The package Access Modifier: 
\f1 accessible to other code in the same package
\f0 \

\fs22 	
\f2\fs20 \cf2 package var x;
\f0\fs24 \cf0 \
\
  - The protected Access Modifier: accessible to other code in the same package, and to subclasses that are in any package\
\pard\pardeftab720\sl340

\f2\fs22 \cf2 	
\fs20 protected var message = "Hello!";
\f0\fs24 \cf0 \
\pard\pardeftab720\sl340\ql\qnatural
\cf0 \
  - The public Access Modifier: can be accessed from any class or script, in any package\

\fs22 	
\f2\fs20 \cf2 public var message = "Hello from class one!";
\f0\fs24 \cf0 \
\
  - The public-read Access Modifier: 
\f1 publicly readable, but (by default) is writeable only from within the current script
\f0 \
\pard\pardeftab720\sl340

\f2\fs22 \cf2 	
\fs20 public-read var x = 1;
\f0\fs24 \cf0 \
\pard\pardeftab720\sl340\ql\qnatural
\cf0 \
  - The public-init Access Modifier: can be publicly initialized by object literals in any package\
\pard\pardeftab720\sl340

\f2\fs22 \cf2 	
\fs20 public-init var message;
\f0\fs24 \cf0 \
\pard\pardeftab720\sl340\ql\qnatural
\cf0 \
}